import os
import datetime

website_config = {
    "admin_id": 1,
    "name" : "后台管理系统",
    "email": "",
    "beian": "浙123456789",
    "copyright": "{0} Yang".format(datetime.datetime.now().year)
}

class Config(object):
    ''' 配置 '''
    SECRET_KEY = os.urandom(24)

    # 数据库配置
    SQLALCHEMY_DATABASE_URI = "mysql://test01:123456@127.0.0.1:3306/test01?charset=utf8"
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    # 输出sql语句
    SQLALCHEMY_ECHO = False
    # 自动提交
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True

class DevelopmentConfig(Config):
    ''' 测试环境配置 '''
    DEBUG = True

class ProductionConfig(Config):
    ''' 线上环境 '''
    pass

config = {
    "development": DevelopmentConfig,
    "product": ProductionConfig,
}